# coding=utf-8
import maya.cmds as cmds

def RemoveUnloadedRef():
	referencePresent = cmds.file(q=1, reference=1)
	if len(referencePresent):
		for i in range(len(referencePresent)):
			if not cmds.referenceQuery(referencePresent[i],isLoaded=1 ):
				cmds.file(referencePresent[i],rr=1)
				